<?php
/**
 * Created by PhpStorm.
 * User: 何培春
 * Date: 2017/9/15
 * Time: 9:09
 */

namespace Cs\Controller;
use Think\Controller;


class BaseControlle extends Controller
{
    public function __construct()
    {
        parent::__construct();
        $uid = I('session.studentid',0,'intval');
        if (!$uid){
            Header("HTTP/1.1 301 Moved Permanently");
            Header("Location: ".U('Home/Register/Login'));
        }
        $student_information = M('student_information');
        $ret_student_information = $student_information->where(array('uid'=>$uid))->find();
        if (!$ret_student_information){
            Header("HTTP/1.1 301 Moved Permanently");
            Header("Location: ".U('Home/Register/Login'));
        }
        $this->assign('student_information',$ret_student_information);
    }

}